package com.lyu.xiaolvshu.oss.biz.config;

import jakarta.annotation.Resource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import io.minio.MinioClient;

@Configuration
public class MinioConfig {

	@Resource
	private MinioProperties minioProperties;

	@Bean
	public MinioClient minioClient() {
		// 构建 Minio 客户端
		return MinioClient.builder()
				.endpoint(minioProperties.getEndpoint())
				.credentials(minioProperties.getAccessKey(), minioProperties.getSecretKey())
				.build();
	}
}
